﻿using Iit.Automation.Browsers.Shared;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Interactions;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Iit.Automation.Browsers.IE
{
    public class IEBrowser : InternetExplorerDriver, IBrowser
    {
        private static IEBrowser _instance;
        private string _folderPath;

        private IEBrowser(string WebdriverFolderPath)
            : base(WebdriverFolderPath)
        {
            
            _folderPath = WebdriverFolderPath;
        }

        public static IBrowser GetInstance(string folderPath)
        {
            if (_instance == null)
            {
                _instance = CreateNewInstance(folderPath);
            }

            return _instance;
        }

        private static IEBrowser CreateNewInstance(string folderPath)
        {
            return new IEBrowser(folderPath);
        }

        public string DriverFolderPath
        {
            get { return _folderPath; }
        }

        public IComponentFactory ComponentFactory { get; set; }


        public Actions GetAction()
        {
            throw new NotImplementedException();
        }
    }
}
